<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <input type="text" value="abcd">
    <input type="button" value="按钮" onclick="f1()">
    <div>div</div>
    <span>span</span>
</body>
<script>
    //通过选择器去找到页面中的div
    let d = document.querySelector("div");
    //修改div的内容
    d.innerText = "div内容修改了啊";

    let s = document.querySelector("span");
    s.innerText = "span周末就要考研了呀";

    let ip = document.querySelector("input");
    //修改控件的值
    ip.value = "文本框的内容发生了变化！";

    function f1() {
        d.innerText = ip.value;
    }


</script>
</html>
